﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TMIS.DAL
{
    public class InstructionOpinion
    {
        private Model.ThesisDB db = new Model.ThesisDB();

        #region 更新指导教师评阅意见表信息
        public void Update(Model.InstructionOpinion instructionopinion)
        {
            Model.InstructionOpinion ins = db.InstructionOpinion.Single(e => e.ID == instructionopinion.ID);
            ins.Attitude = instructionopinion.Attitude;
            ins.Survey = instructionopinion.Survey;
            ins.Design = instructionopinion.Design;
            ins.Ability = instructionopinion.Ability;
            ins.Quality = instructionopinion.Quality;
            ins.Innovation = instructionopinion.Innovation;
            ins.TotalScore = instructionopinion.TotalScore;
            db.SubmitChanges();
        }
        #endregion
        /// <summary>
        /// 获取指定ID号的指导教师评阅意见表
        /// </summary>
        /// <param name="guid"></param>
        /// <returns></returns>
        public Model.InstructionOpinion Get(Guid guid)
        {
            Model.InstructionOpinion ins= db.InstructionOpinion.FirstOrDefault(e => e.ID == guid);
            return ins;
        }
        /// <summary>
        /// 生成新的指导教师评阅意见表
        /// </summary>
        /// <param name="instructionOpinion"></param>
        public void Insert(Model.InstructionOpinion instructionOpinion)
        {
            db.InstructionOpinion.InsertOnSubmit(instructionOpinion);
            db.SubmitChanges();
        }
    }
}
